<VirtualHost *:80>
	ServerName distro-tracker

	CustomLog ${APACHE_LOG_DIR}/distro-tracker-access.log combined
	ErrorLog ${APACHE_LOG_DIR}/distro-tracker-error.log
	LogLevel warn

	Alias /static /var/lib/distro-tracker/static
	Alias /media /var/lib/distro-tracker/media

	<Directory /var/lib/distro-tracker>
		Order allow,deny
		Allow from all
		SetHandler None
		FileETag none
		Options FollowSymLinks

		<IfModule mod_expires.c>
			ExpiresActive On
			ExpiresByType image/gif "access plus 30 days"
			ExpiresByType image/jpg "access plus 30 days"
			ExpiresByType image/png "access plus 30 days"
			ExpiresByType image/jpeg "access plus 30 days"
			ExpiresByType text/css "access plus 30 days"
			ExpiresByType application/javascript "modification plus 2 years"
			ExpiresByType application/x-javascript "modification plus 2 years"
		</IfModule>

		<IfModule mod_headers.c>
			Header append Vary Accept-Encoding
		</IfModule>

		AddOutputFilterByType DEFLATE text/html text/css text/plain
	</Directory>

	WSGIDaemonProcess distro-tracker user=distro-tracker group=distro-tracker processes=4 maximum-requests=500 threads=1 display-name=%{GROUP}
	WSGIProcessGroup distro-tracker
	WSGIScriptAlias / /usr/share/pyshared/distro_tracker/project/wsgi.py
</VirtualHost>

<VirtualHost *:443>
	ServerName distro-tracker

	CustomLog ${APACHE_LOG_DIR}/distro-tracker-access.log combined
	ErrorLog ${APACHE_LOG_DIR}/distro-tracker-error.log
	LogLevel warn

        SSLEngine on

	# Update certificates files here
        SSLCertificateFile    /etc/ssl/certs/ssl-cert-snakeoil.pem
        SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key

	Alias /static /var/lib/distro-tracker/static
	Alias /media /var/lib/distro-tracker/media

	<Directory /var/lib/distro-tracker>
		Order allow,deny
		Allow from all
		SetHandler None
		FileETag none
		Options FollowSymLinks

		<IfModule mod_expires.c>
			ExpiresActive On
			ExpiresByType image/gif "access plus 30 days"
			ExpiresByType image/jpg "access plus 30 days"
			ExpiresByType image/png "access plus 30 days"
			ExpiresByType image/jpeg "access plus 30 days"
			ExpiresByType text/css "access plus 30 days"
			ExpiresByType application/javascript "modification plus 2 years"
			ExpiresByType application/x-javascript "modification plus 2 years"
		</IfModule>

		<IfModule mod_headers.c>
			Header append Vary Accept-Encoding
		</IfModule>

		AddOutputFilterByType DEFLATE text/html text/css text/plain
	</Directory>

	WSGIProcessGroup distro-tracker
	WSGIScriptAlias / /usr/share/pyshared/distro_tracker/project/wsgi.py
</VirtualHost>
